package com.qianxp.authorize.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.qianxp.authorize.entity.Function;
import com.qianxp.authorize.entity.Role;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface RoleMapper extends BaseMapper<Role> {
    @Select("select f.* from sfunction f inner join role_function rf on f.id = rf.functionid where rf.roleid = #{role.id}")
    List<Function> getFunctions(@Param("role") Role role);
}
